# Docker 镜像构建
# @author 小骏🐊
FROM maven:3.8.1-openjdk-17-slim as builder

# 解决容器时期与真实时间相差 8 小时的问题
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone

# 复制本地代码到容器.
WORKDIR /app
COPY pom.xml .
COPY src ./src

# 打包并且跳过单元测试.
RUN mvn package -DskipTests

# 运行.
CMD ["java","-jar","/app/target/jundada-backend-0.0.1-SNAPSHOT.jar","--spring.profiles.active=prod"]